package jtk.project4.fleet.ibatis.dao;

import java.sql.SQLException;
import java.util.List;

import jtk.project4.fleet.domain.PoD;



public class PoDDao extends IbatisDao{
	
	public List selectPoD() throws SQLException{
		List selectPoD = null;
			selectPoD = getSqlMap().queryForList("SELECT_ALL_POD", null);
		return selectPoD;
	}
	
	public int deletePoD(PoD pod) throws SQLException{
		return (int) getSqlMap().delete("DELETE_POD", pod);
		
	}
	
	public int updatePoD(PoD pod) throws SQLException{
		return (int) getSqlMap().update("UPDATE_POD", pod);
	}
	
	public PoD insertPoD(PoD pod) throws SQLException{
		return (PoD) getSqlMap().insert("INSERT_POD", pod);
	}

	
	public static void main (String args[]) throws SQLException{
		List<PoD> pod;
		pod = new PoDDao().selectPoD();
		System.out.println(pod.size());
		
		/*
 		Cara Select
 
 		List<PoD> pod;
		pod = new PoDDao().selectPoD();
		System.out.println(pod.size());
		*/
		
		/*
		cara insert
		
		PoD pod;
		pod = new PoD();
		
		pod.setName("ee");
		new PoDDao().insertPoD(pod);  
		 
		*/
		
		
		/*
		cara update
		
		PoD pod;
		pod = new PoD();
		
		pod.setPoDId(12);
		pod.setName("ee");
		new PoDDao().updatePoD(pod);  
		 
		*/
		
		/*
		cara delete
		
		PoD pod;
		pod = new PoD();
		pod.setPoDId(12);
		new PoDDao().deletePoD(pod);
		*/
	}
	
	

}
